﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace thinger.AutomaticStoreMotionDAL
{
    public class SqlSugarHelper
    {
        public static string connectionString = string.Empty;

        public static SqlSugarClient SqlSugarClient
        {
            get
            {
                ConnectionConfig connectionConfig = new ConnectionConfig();
                connectionConfig.ConnectionString = connectionString; 
                connectionConfig.DbType = DbType.Sqlite;               //设置数据库类型
                connectionConfig.IsAutoCloseConnection = true;         //自动释放数据库，如果存在事务，在事务结束后释放 
                connectionConfig.InitKeyType = InitKeyType.Attribute;  //从实体特性中读取主键自增信息

                SqlSugarClient sqlSugarClient = new SqlSugarClient(connectionConfig);
                return sqlSugarClient;
            }
        }

    }
}
